import 'bloc/app_navigation_bloc.dart';
import 'models/app_navigation_model.dart';
import 'package:flutter/material.dart';
import 'package:syria_sports/core/app_export.dart';

/*
class AppNavigationScreen extends StatelessWidget {
  const AppNavigationScreen({Key? key})
      : super(
          key: key,
        );

  static Widget builder(BuildContext context) {
    return BlocProvider<AppNavigationBloc>(
      create: (context) => AppNavigationBloc(AppNavigationState(
        appNavigationModelObj: const AppNavigationModel(),
      ))
        ..add(AppNavigationInitialEvent()),
      child: const AppNavigationScreen(),
    );
  }

  @override
  Widget build(BuildContext context) {
    mediaQueryData = MediaQuery.of(context);

    return BlocBuilder<AppNavigationBloc, AppNavigationState>(
      builder: (context, state) {
        return SafeArea(
          child: Scaffold(
            backgroundColor: const Color(0XFFFFFFFF),
            body: SizedBox(
              width: double.maxFinite,
              child: Column(
                children: [
                  _buildAppNavigation(context),
                  Expanded(
                    child: SingleChildScrollView(
                      child: Container(
                        decoration: const BoxDecoration(
                          color: Color(0XFFFFFFFF),
                        ),
                        child: Column(
                          children: [
                            _buildScreenTitle(
                              context,
                              screenTitle: "Splash Screen".tr,
                              screenName: AppRoutes.splashScreen,
                              onTapScreenTitle: () =>
                                  onTapScreenTitle(AppRoutes.splashScreen),
                            ),
                            _buildScreenTitle(
                              context,
                              screenTitle: "Login".tr,
                              screenName: AppRoutes.loginScreen,
                              onTapScreenTitle: () =>
                                  onTapScreenTitle(AppRoutes.loginScreen),
                            ),
                            _buildScreenTitle(
                              context,
                              screenTitle: "Register".tr,
                              screenName: AppRoutes.registerScreen,
                              onTapScreenTitle: () =>
                                  onTapScreenTitle(AppRoutes.registerScreen),
                            ),
                            _buildScreenTitle(
                              context,
                              screenTitle: "Dashboard - Container".tr,
                              screenName: AppRoutes.dashboardContainerScreen,
                              onTapScreenTitle: () => onTapScreenTitle(
                                  AppRoutes.dashboardContainerScreen),
                            ),
                            _buildScreenTitle(
                              context,
                              screenTitle: "Super Flash Sale".tr,
                              screenName: AppRoutes.superFlashSaleScreen,
                              onTapScreenTitle: () => onTapScreenTitle(
                                  AppRoutes.superFlashSaleScreen),
                            ),
                            _buildScreenTitle(
                              context,
                              screenTitle: "Favorite Product".tr,
                              screenName: AppRoutes.favoriteProductScreen,
                              onTapScreenTitle: () => onTapScreenTitle(
                                  AppRoutes.favoriteProductScreen),
                            ),
                            _buildScreenTitle(
                              context,
                              screenTitle: "Product Detail".tr,
                              screenName: AppRoutes.productDetailScreen,
                              onTapScreenTitle: () => onTapScreenTitle(
                                  AppRoutes.productDetailScreen),
                            ),
                            _buildScreenTitle(
                              context,
                              screenTitle: "Review Product".tr,
                              screenName: AppRoutes.reviewProductScreen,
                              onTapScreenTitle: () => onTapScreenTitle(
                                  AppRoutes.reviewProductScreen),
                            ),
                            _buildScreenTitle(
                              context,
                              screenTitle: "Write Review Fill".tr,
                              screenName: AppRoutes.writeReviewFillScreen,
                              onTapScreenTitle: () => onTapScreenTitle(
                                  AppRoutes.writeReviewFillScreen),
                            ),
                            _buildScreenTitle(
                              context,
                              screenTitle: "Search".tr,
                              screenName: AppRoutes.searchScreen,
                              onTapScreenTitle: () =>
                                  onTapScreenTitle(AppRoutes.searchScreen),
                            ),
                            _buildScreenTitle(
                              context,
                              screenTitle: "Search Result".tr,
                              screenName: AppRoutes.searchResultScreen,
                              onTapScreenTitle: () => onTapScreenTitle(
                                  AppRoutes.searchResultScreen),
                            ),
                            _buildScreenTitle(
                              context,
                              screenTitle: "Search Result No Data Found".tr,
                              screenName: AppRoutes.searchResultNoDataFoundScreen,
                              onTapScreenTitle: () => onTapScreenTitle(
                                  AppRoutes.searchResultNoDataFoundScreen),
                            ),
                            _buildScreenTitle(
                              context,
                              screenTitle: "List Category".tr,
                              screenName: AppRoutes.listCategoryScreen,
                              onTapScreenTitle: () => onTapScreenTitle(
                                  AppRoutes.listCategoryScreen),
                            ),
                            _buildScreenTitle(
                              context,
                              screenTitle: "Sort By".tr,
                              screenName: AppRoutes.sortByScreen,
                              onTapScreenTitle: () =>
                                  onTapScreenTitle(AppRoutes.sortByScreen),
                            ),
                            _buildScreenTitle(
                              context,
                              screenTitle: "Filter".tr,
                              screenName: AppRoutes.filterScreen,
                              onTapScreenTitle: () =>
                                  onTapScreenTitle(AppRoutes.filterScreen),
                            ),
                            _buildScreenTitle(
                              context,
                              screenTitle: "Ship To".tr,
                              screenName: AppRoutes.shipToScreen,
                              onTapScreenTitle: () =>
                                  onTapScreenTitle(AppRoutes.shipToScreen),
                            ),
                            _buildScreenTitle(
                              context,
                              screenTitle: "Success Screen".tr,
                              screenName: AppRoutes.successScreen,
                              onTapScreenTitle: () =>
                                  onTapScreenTitle(AppRoutes.successScreen),
                            ),
                            _buildScreenTitle(
                              context,
                              screenTitle: "Profile".tr,
                              screenName: AppRoutes.profileScreen,
                              onTapScreenTitle: () =>
                                  onTapScreenTitle(AppRoutes.profileScreen),
                            ),
                            _buildScreenTitle(
                              context,
                              screenTitle: "Change Password".tr,
                              screenName: AppRoutes.changePasswordScreen,
                              onTapScreenTitle: () => onTapScreenTitle(
                                  AppRoutes.changePasswordScreen),
                            ),
                            _buildScreenTitle(
                              context,
                              screenTitle: "Order".tr,
                              screenName: AppRoutes.orderScreen,
                              onTapScreenTitle: () =>
                                  onTapScreenTitle(AppRoutes.orderScreen),
                            ),
                            _buildScreenTitle(
                              context,
                              screenTitle: "Order Details".tr,
                              screenName: AppRoutes.orderDetailsScreen,
                              onTapScreenTitle: () => onTapScreenTitle(
                                  AppRoutes.orderDetailsScreen),
                            ),
                            _buildScreenTitle(
                              context,
                              screenTitle: "Add Address".tr,
                              screenName: AppRoutes.addAddressScreen,
                              onTapScreenTitle: () =>
                                  onTapScreenTitle(AppRoutes.addAddressScreen),
                            ),
                            _buildScreenTitle(
                              context,
                              screenTitle: "Address".tr,
                              screenName: AppRoutes.addressScreen,
                              onTapScreenTitle: () =>
                                  onTapScreenTitle(AppRoutes.addressScreen),
                            ),
                            _buildScreenTitle(
                              context,
                              screenTitle: "Lailyfa Febrina Card".tr,
                              screenName: AppRoutes.lailyfaFebrinaCardScreen,
                              onTapScreenTitle: () => onTapScreenTitle(
                                  AppRoutes.lailyfaFebrinaCardScreen),
                            ),
                          ],
                        ),
                      ),
                    ),
                  ),
                ],
              ),
            ),
          ),
        );
      },
    );
  }

  /// Section Widget
  Widget _buildAppNavigation(BuildContext context) {
    return Container(
      decoration: const BoxDecoration(
        color: Color(0XFFFFFFFF),
      ),
      child: Column(
        children: [
          SizedBox(height: 10.v),
          Align(
            alignment: Alignment.centerLeft,
            child: Padding(
              padding: EdgeInsets.symmetric(horizontal: 20.h),
              child: Text(
                "App Navigation".tr,
                textAlign: TextAlign.center,
                style: TextStyle(
                  color: const Color(0XFF000000),
                  fontSize: 20.fSize,
                  fontFamily: 'Roboto',
                  fontWeight: FontWeight.w400,
                ),
              ),
            ),
          ),
          SizedBox(height: 10.v),
          Align(
            alignment: Alignment.centerLeft,
            child: Padding(
              padding: EdgeInsets.only(left: 20.h),
              child: Text(
                "Check your app's UI from the below demo screens of your app."
                    .tr,
                textAlign: TextAlign.center,
                style: TextStyle(
                  color: const Color(0XFF888888),
                  fontSize: 16.fSize,
                  fontFamily: 'Roboto',
                  fontWeight: FontWeight.w400,
                ),
              ),
            ),
          ),
          SizedBox(height: 5.v),
          Divider(
            height: 1.v,
            thickness: 1.v,
            color: const Color(0XFF000000),
          ),
        ],
      ),
    );
  }

  /// Common widget
  Widget _buildScreenTitle(
    BuildContext context, {
    required String screenTitle,
    required String screenName,
    Function? onTapScreenTitle,
  }) {
    return GestureDetector(
      onTap: () {
        onTapScreenTitle!.call();
      },
      child: Container(
        decoration: const BoxDecoration(
          color: Color(0XFFFFFFFF),
        ),
        child: Row(
          children: [
            Expanded(
              child: Padding(
                padding: EdgeInsets.symmetric(horizontal: 8.h),
                child: Text(
                  screenTitle,
                  maxLines: 99,
                  style: TextStyle(
                    color: const Color(0XFF000000),
                    fontSize: 18.fSize,
                    fontFamily: 'Roboto',
                    fontWeight: FontWeight.w400,
                  ),
                ),
              ),
            ),
            Container(
              height: MediaQuery.of(context).size.height-202,
              width: MediaQuery.of(context).size.width-102,
              margin:const EdgeInsets.only(top: 4 , bottom: 16, left: 8 , right: 8),
              padding:const EdgeInsets.symmetric(vertical: 8,horizontal: 2),
              decoration: BoxDecoration(
                  borderRadius:BorderRadius.circular(16),
                  color: Colors.black45,
                  boxShadow:const [
                    BoxShadow(
                        color: Colors.black45,
                        blurRadius: 7,
                        spreadRadius: 2,
                        offset: Offset(2,5)
                    )
                  ]
              ),
              child: Container(
                  height: MediaQuery.of(context).size.height-200,
                  width: MediaQuery.of(context).size.width-100,
                  clipBehavior: Clip.antiAlias,
                  decoration: BoxDecoration(
                      borderRadius:BorderRadius.circular(16),
                  ),
                  child: AppRoutes.routes[screenName]!.call(context)),
            ),
          ],
        ),
      ),
    );
  }

  /// Common click event
  void onTapScreenTitle(String routeName) {
    NavigatorService.pushNamed(routeName);
  }
}
*/
